<?php
namespace app\admin\validate;

use think\Validate;

/**
 * 用户地址验证器
 * Class UserInfo
 */
class UserInfo extends Validate
{
    protected $rule = [
        'username'  => 'require|max:25',
        'phone'   => ['regex'=>'/^1[3|4|5|7|8][0-9]\d{4,8}$/'],
        'email' => 'email',
        'repassword' => 'require|confirm:password',
    ];

    protected $message = [
        'username.require' => '名称必须',
        'username.max' => '名称最多不能超过25个字符',
        'phone.regex' => '手机号码格式错误',
        'email' => '邮箱格式错误',
        'repassword.confirm' => '两次输入密码必须相同',
    ];

}